home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / PadHop.dxr / Internal_6_the frog.ls < prev    next >
Encoding:
Text File  |  2002-01-31  |  5.3 KB  |  186 lines

  1. property pSprite, spriteNum, pLocV, pFullScale, pScale, pHighScale, pFuck
  2. global gFrog, gInMotion, gFloats, gCurrentFloat, gLives, sp, gScore, gScoreBox, gLivesIcons, splashEffect, levelnum
  3.  
  4. on beginSprite me
  5.   pSprite = sprite(spriteNum)
  6.   gFrog = pSprite
  7.   pLocV = pSprite.locV
  8.   pSprite.loc = gFloats[1].loc
  9.   pFullScale = [float(pSprite.width), float(pSprite.height)]
  10.   pScale = 1.0
  11.   pFuck = 1
  12.   pSprite.locZ = spriteNum
  13. end
  14.  
  15. on mouseDown me
  16.   gCurrentFloat.mouseDown()
  17. end
  18.  
  19. on mJump me
  20.   pSprite.member = member("frog2")
  21.   pHighScale = 0
  22.   timeout("jump").new(10, #jumpFrom, me)
  23. end
  24.  
  25. on mBlink me
  26.   pSprite.visible = 0
  27.   s = the ticks + 5
  28.   repeat while the ticks < s
  29.     updateStage()
  30.   end repeat
  31.   pSprite.visible = 1
  32.   s = the ticks + 5
  33.   repeat while the ticks < s
  34.     updateStage()
  35.   end repeat
  36.   pSprite.visible = 0
  37.   s = the ticks + 5
  38.   repeat while the ticks < s
  39.     updateStage()
  40.   end repeat
  41.   pSprite.visible = 1
  42.   s = the ticks + 5
  43.   repeat while the ticks < s
  44.     updateStage()
  45.   end repeat
  46.   pSprite.visible = 0
  47.   s = the ticks + 5
  48.   repeat while the ticks < s
  49.     updateStage()
  50.   end repeat
  51.   pSprite.visible = 1
  52.   s = the ticks + 5
  53.   repeat while the ticks < s
  54.     updateStage()
  55.   end repeat
  56. end
  57.  
  58. on jumpFrom me
  59.   if (pScale < 2.0) and not pHighScale then
  60.     pFuck = 1
  61.     pScale = pScale + 0.05
  62.     pSprite.width = pFullScale[1] * pScale
  63.     pSprite.height = pFullScale[2] * pScale
  64.     if pScale >= 1.5 then
  65.       pHighScale = 1
  66.     end if
  67.     if (pSprite.locV - gFloats[gFloats.findPos(gCurrentFloat) + 1].locV) > 0 then
  68.       pSprite.locV = pSprite.locV - 7.5
  69.     end if
  70.   else
  71.     if pScale > 1 then
  72.       pScale = pScale - 0.05
  73.       pSprite.width = pFullScale[1] * pScale
  74.       pSprite.height = pFullScale[2] * pScale
  75.       if (pSprite.locV - gFloats[gFloats.findPos(gCurrentFloat) + 1].locV) > 0 then
  76.         pSprite.locV = pSprite.locV - 7.5
  77.       end if
  78.     else
  79.       if isFrogOn(gFloats[gFloats.findPos(gCurrentFloat) + 1]) and pFuck and gFloats[gFloats.findPos(gCurrentFloat) + 1].visible then
  80.         gScore = gScore + (((5 * gLives) + (gLives * (gFloats.findPos(gCurrentFloat) + 1))) * levelnum)
  81.         if gLives <= 0 then
  82.           gScore = gScore + (5 * levelnum)
  83.         end if
  84.         gScoreBox.text = string(gScore)
  85.         pSprite.member = member("frog1")
  86.         gCurrentFloat = gFloats[gFloats.findPos(gCurrentFloat) + 1]
  87.         pLocV = pSprite.locV
  88.         pHighScale = 0
  89.         timeout("jump").forget()
  90.         if gFloats.findPos(gCurrentFloat) = gFloats.count then
  91.           s = the ticks + 150
  92.           repeat while the ticks < s
  93.             updateStage()
  94.           end repeat
  95.           if gLives = 5 then
  96.             gScore = gScore + (50 * levelnum)
  97.             gScoreBox.text = string(gScore)
  98.           end if
  99.           if levelnum = 3 then
  100.             go("Game over")
  101.           else
  102.             levelnum = levelnum + 1
  103.             go("level com")
  104.           end if
  105.         else
  106.           if gCurrentFloat.member.name = "turtle" then
  107.             timeout("follow").new(30, #followCurrentFloat, me)
  108.           else
  109.             if gCurrentFloat.pFla then
  110.               timeout("followy").new(30, #followCurrentFloat, me)
  111.             end if
  112.           end if
  113.           if (gFloats.findPos(gCurrentFloat) <> 1) and (gFloats.findPos(gCurrentFloat) <> 19) and ((gFloats.findPos(gCurrentFloat) mod 2) <> 0) then
  114.             gInMotion = 1
  115.             repeat with i in gFloats
  116.               i.pGo = 1
  117.               updateStage()
  118.             end repeat
  119.           end if
  120.         end if
  121.       else
  122.         if pSprite.locZ > 2 then
  123.           puppetSound(6, member("splashfx"))
  124.           splashEffect.loc = pSprite.loc
  125.           splashEffect.member = member("splash")
  126.           timeout("remove").new(1300, #removeSplash, me)
  127.         end if
  128.         pSprite.locZ = 2
  129.         pFuck = 0
  130.         pSprite.member = member("frog3")
  131.         if pScale > 0.55000000000000004 then
  132.           if pSprite.blend > 0 then
  133.             pSprite.blend = pSprite.blend - 1
  134.           end if
  135.           pScale = pScale - 0.005
  136.           pSprite.width = pFullScale[1] * pScale
  137.           pSprite.height = pFullScale[2] * pScale
  138.         else
  139.           if gLives > 0 then
  140.             gLivesIcons[gLives].visible = 0
  141.           end if
  142.           gLives = gLives - 1
  143.           pHighScale = 0
  144.           timeout("jump").forget()
  145.           if gLives >= 0 then
  146.             pSprite.blend = 100
  147.             pSprite.locZ = spriteNum
  148.             pScale = 1.0
  149.             gFrog.member = member("frog1")
  150.             gFrog.loc = gCurrentFloat.loc
  151.             pLocV = gFrog.locV
  152.             gFrog.width = pFullScale[1]
  153.             gFrog.height = pFullScale[2]
  154.             if gCurrentFloat.member.name = "turtle" then
  155.               timeout("follow").new(25, #followCurrentFloat, me)
  156.             else
  157.               if gCurrentFloat.pFla then
  158.                 timeout("followy").new(25, #followCurrentFloat, me)
  159.               end if
  160.             end if
  161.             gInMotion = 1
  162.             gFrog.mBlink()
  163.             gInMotion = 0
  164.           else
  165.             go("Game over")
  166.           end if
  167.         end if
  168.       end if
  169.     end if
  170.   end if
  171. end
  172.  
  173. on removeSplash me
  174.   timeout("remove").forget()
  175.   splashEffect.member = member("dottie")
  176.   splashEffect.loc = point(-100, -100)
  177. end
  178.  
  179. on followCurrentFloat me
  180.   if gCurrentFloat.member.name = "turtle" then
  181.     pSprite.loc = pSprite.loc + [gCurrentFloat.pSpeed, 0]
  182.   else
  183.     pSprite.loc = pSprite.loc + [gCurrentFloat.pdir, 0]
  184.   end if
  185. end
  186.